import yunRequest from "./api";

const baseUrl = getApp().globalData.apiBaseUrl;

// 获取一级辖区信息
export function getFirstAddress() {
    let url = baseUrl + "/address/getFirstAddressList"
    return yunRequest.post(url);
}

// 获取二级辖区信息
export function getSecondAddress(id) {
    let url = baseUrl + "/address/getSecondAddressListByFid"
    return yunRequest.post(url, {
        id
    });
}

// 获取二级管理员辖区列表
export function getSecondAddressList(addressList) {
    let url = baseUrl + "/address/getSecondAddressList"
    return yunRequest.post(url, {
        addressList
    });
}

// 获取所有辖区信息
export function getAllAddressList() {
    let url = baseUrl + "/address/getAllAddressList"
    return yunRequest.post(url);
}


// 通过关键字查询辖区信息列表
export function searchAddressList(address) {
    let url = baseUrl + "/address/searchAddressList"
    return yunRequest.post(url, {
        address
    });
}


// 获取地图标点
export function getMapIcon(greenIcon, yellowIcon, redIcon, addressList) {
    let url = baseUrl + "/address/getMapIcon"
    return yunRequest.post(url, {
        greenIcon,
        yellowIcon,
        redIcon,
        addressList
    });
}
// 获取详细事件地图标点
export function getDetailMapIcon(greenIcon) {
    let url = baseUrl + "/address/getAdviseMapIcon"
    return yunRequest.get(url, {
        greenIcon
    });
}
// 获取辖区信息
export function getAddressInfo(id) {
    let url = baseUrl + "/address/getAddressInfo"
    return yunRequest.post(url, {
        id
    });
}